#include "native/java/lang/String.hpp"
#include "rtda/heap/class.h"
#include "rtda/heap/string_pool.h"

namespace jvm {
    namespace lang {

        const std::string StringNative::JL_STRING = "java/lang/String";

        void StringNative::intern(std::shared_ptr<rtda::Frame> frame) {
            auto thisObj = frame->getLocalVars().getThis();
            auto interned = heap::StringPool::getInstance().internString(thisObj);
            frame->getOperandStack()->pushRef(interned);
        }

    } // namespace lang
} // namespace jvm